AsEnumerable(TSource) Method

Task Parallel System.Threading

Converts a ParallelQuery<(Of <(TSource>)>) into an IEnumerable<(Of <(T>)>) to force sequential evaluation of the query.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function AsEnumerable(Of TSource) ( _
	source As ParallelQuery(Of TSource) _
) As IEnumerable(Of TSource)
C#
public static IEnumerable<TSource> AsEnumerable<TSource>(
	ParallelQuery<TSource> source
)

Parameters

source
Type: System.Linq..::.ParallelQuery<(Of <(TSource>)>)
The sequence to type as IEnumerable<(Of <(T>)>).

Type Parameters

TSource
The type of the elements of source.

Return Value

The input sequence types as IEnumerable<(Of <(T>)>).

Exceptions

ExceptionCondition
System..::.ArgumentNullException source is a null reference (Nothing in Visual Basic).

See Also